package com.xilihui.xlh.business.requests;

import com.xilihui.xlh.business.entities.LoginEntity;
import com.xilihui.xlh.core.app.BaseEntity;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by Administrator on 2018/6/20.
 */

interface LoginService {
    
    //登录
    @FormUrlEncoded
    @POST("api/login/login")
    Observable<LoginEntity> login(
            @Field("mobile") String mobile,
            @Field("password") String password,
            @Field("app_key") String app_key,
            @Field("temptime") String temptime,
            @Field("sign") String sign,
            @Field("device_token") String device_token
    );
    
    //短信登录
    @FormUrlEncoded
    @POST("api/login/login_by_msg")
    Observable<LoginEntity> smsLogin(
            @Field("mobile") String moblie,
            @Field("code") String code,
            @Field("app_key") String app_key,
            @Field("temptime") String temptime,
            @Field("sign") String sign,
            @Field("device_token") String device_token
    );
    
    //注册
    @FormUrlEncoded
    @POST("api/login/registe")
    Observable<BaseEntity> reg(
            @Field("mobile") String mobile,
            @Field("password") String password,
            @Field("repassword") String repassword,
            @Field("code") String code,
            @Field("app_key") String app_key,
            @Field("temptime") String temptime,
            @Field("sign") String sign
    );
    
    //发送验证码
    @GET("api/login/send_code")
    Observable<BaseEntity> sendCode(
            @Query("mobile") String mobile,
            @Query("scene") String scene
    );
    
    //忘记密码
    @GET("api/Login/repassword_one")
    Observable<LoginEntity> forget(
            @Query("mobile") String mobile,
            @Query("app_key") String app_key,
            @Query("code") String code,
            @Query("scene") String scene,
            @Query("temptime") String temptime,
            @Query("sign") String sign
    );
    
    //忘记密码 第二步
    @FormUrlEncoded
    @POST("api/login/repassword_two")
    Observable<BaseEntity> forgetNext(
            @Field("access_token") String access_token,
            @Field("app_key") String app_key,
            @Field("user_id") String user_id,
            @Field("password") String password,
            @Field("repassword") String repassword,
            @Field("temptime") String temptime,
            @Field("sign") String sign
    );
    
}
